import { MidwayConfig } from '@midwayjs/core';

export default {
  // use for cookie sign key, should change to your own and keep security
  keys: '1697698256003_4706',
  koa: {
    port: 7001,
  },
  typeorm:{
    dataSource: {
      default: {
        /**
         * 单数据库实例
         */
        type: 'mysql',
        host: "127.0.0.1",
        port: 3306,
        username: 'fengshuo2',
        password: 'EMbAAFNz6i7kw8md',
        database: "fengshuo2",
        synchronize: true,     // 如果第一次使用，不存在表，有同步的需求可以写 true，注意会丢数据
        logging: false,

        // 或者扫描形式
        entities: [
          '**/entity/*.entity{.ts,.js}'
        ]
      }
    }
  },
  jwt: {
    secret: '!@#!$#ASDasd', // fs.readFileSync('xxxxx.key')
    expiresIn: '2d', // https://github.com/vercel/ms
  },
  // 配置自动携带token
  swagger: {
    auth: {
      authType: 'bearer',
    },
  },
  redis: {
    client: {
      port: 6379, // Redis port
      host: "123.249.70.8", // Redis host
      password: "allen",
      db: 1 ,
    },
  },
  bull: {
    // 默认的队列配置
    defaultQueueOptions: {
      redis: {
        port: 6379,
        host: '120.25.242.121',
        password: 'mingde123',
      },
    }
  },
} as MidwayConfig;
